/*
 * @Author: wankong
 * @Date: 2021-09-04 15:38:24
 * @LastEditTime: 2021-11-04 08:46:48
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'



Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: Home
  },

  {
    path: "/mmht",
    name: "admin",
    component: () => import('@/views/admin/Login'),
  },
  {
    path: "/home",
    name: "adminHome",
    component: () => import("@/views/admin/Home"),
    children: [{
      path: "/home/welcome",
      component: () => import('@/views/admin/Welcome')
    }, {
      path: "/home/editor",
      component: () => import('@/views/admin/Editor')
    }, {
      path: "/home/article",
      component: () => import('@/views/admin/Article')
    }, {
      path: "/home/tags",
      component: () => import('@/views/admin/Tags')
    }, {
      path: "/home/comment",
      component: () => import('@/views/admin/Comments')
    }, {
      path: "/home/links",
      component: () => import('@/views/admin/Links')
    }, {
      path: "/home/setting",
      component: () => import('@/views/admin/Setting')
    }, {
      path: "/home/cate",
      component: () => import('@/views/admin/Cate')
    }, {
      path: "/home/user",
      component: () => import('@/views/admin/User')
    }, {
      path: "/home/about",
      component: () => import('@/views/admin/About')
    }]
  }
]


const router = new VueRouter({
  routes
})


const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default router